﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Business;
using DataAccess;

namespace BaseWeb.GridView.ExpandGrid
{
    public partial class ShowStudentList : System.Web.UI.Page
    {
        public string ClassId
        {
            get { return Request.QueryString["ClassId"]; }
        }

        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                BindGrid();
            }
        }

        private void BindGrid()
        {
            if (!string.IsNullOrEmpty(ClassId))
            {
                var list = CommonSystem.Instance.Service.GetListByWhere<li_Student>(c => c.ClassId == ClassId);
                this.GridView1.DataSource = list;
                this.GridView1.DataBind();
            }
        }
    }
}
